<?php
$this->pageTitle=Yii::app()->name . ' - Contact Us';
$this->breadcrumbs=array(
    Yii::t('site','Contact'),
);
?>

<h1><?php Yii::t('site','Contact Us'); ?></h1>

<?php if(Yii::app()->user->hasFlash('contact')): ?>

<div class="flash-success">
    <?php echo Yii::app()->user->getFlash('contact'); ?>
</div>

<?php else: ?>

<p>
    <?php echo CHtml::encode(Yii::t('site','If you have business inquiries or other questions, please fill out the following form to contact us.')); ?>
    <?php echo CHtml::encode(Yii::t('site','Thank you.')); ?>
</p>

<div class="wide form">

<?php $form=$this->beginWidget('CActiveForm'); ?>

    <p class="note">
        <?php printf(Yii::t('site','Fields with %s are required.'),'<span class="required">*</span>'); ?>
    </p>

    <?php echo $form->errorSummary($model); ?>

    <div class="row">
        <?php echo $form->labelEx($model,'name'); ?>
        <?php echo $form->textField($model,'name',array('size'=>40)); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'email'); ?>
        <?php echo $form->textField($model,'email',array('size'=>40)); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'subject'); ?>
        <?php echo $form->textField($model,'subject',array('size'=>66,'maxlength'=>128)); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'body'); ?>
        <?php echo $form->textArea($model,'body',array('rows'=>6, 'cols'=>50)); ?>
    </div>

    <?php if(extension_loaded('gd')): ?>
    <div class="row">
        <?php echo $form->labelEx($model,'verifyCode'); ?>
        <div>
        <?php $this->widget('CCaptcha'); ?>
        <?php echo $form->textField($model,'verifyCode'); ?>
        </div>
        <div class="hint">
            <?php echo CHtml::encode(Yii::t('site','Please enter the letters as they are shown in the image above.')); ?>
            <br/>
            <?php echo CHtml::encode(Yii::t('site','Letters are not case-sensitive.')); ?>
        </div>
    </div>
    <?php endif; ?>

    <div class="row buttons">
        <?php echo CHtml::submitButton(Yii::t('site','Submit')); ?>
    </div>

<?php $this->endWidget(); ?>

</div><!-- form -->

<script type="text/javascript">
<!--
jQuery('#ContactForm_name').focus().select();
// -->
</script>

<?php endif; ?>
